package com.tuzhi.vo.web;

import com.fasterxml.jackson.annotation.JsonInclude;

@JsonInclude(JsonInclude.Include.NON_NULL)
public class PageVO <T>{

    int page = 1;
    int size = 20;

    int totalPage;
    long totalNum;

    T reqData;

    Object data;

    String orderName;
    String orderType;

    public PageVO() {
    }

    public PageVO(int page, int size) {
        this.page = page;
        this.size = size;
    }

    public PageVO(int page, int size, Object data) {
        this.page = page;
        this.size = size;
        this.data = data;
    }

    public PageVO(int page, int size, Object data, String orderName, String orderType) {
        this.page = page;
        this.size = size;
        this.data = data;
        this.orderName = orderName;
        this.orderType = orderType;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public T getReqData() {
        return reqData;
    }

    public void setReqData(T reqData) {
        this.reqData = reqData;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public String getOrderName() {
        return orderName;
    }

    public void setOrderName(String orderName) {
        this.orderName = orderName;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public long getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(long totalNum) {
        this.totalNum = totalNum;
    }

    public int queryPage() {
        int p = this.page - 1;
        return p < 0 ? 0 : p;
//        return page - 1;
    }

}
